home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / pdcurs21 / private / _ckbiosk.c < prev    next >
C/C++ Source or Header  |  1993-10-30  |  2KB  |  72 lines

  1. #if    defined (DOS)
  2. #include <conio.h>
  3. #endif
  4.  
  5. #define    CURSES_LIBRARY    1
  6. #define NEEDS_OS2       1
  7. #include <curses.h>
  8.  
  9. #ifdef PDCDEBUG
  10. char *rcsid__ckbiosk = "$Header: C:\CURSES\private\RCS\_ckbiosk.c 2.1 1993/06/18 20:22:32 MH Rel MH $";
  11. #endif
  12.  
  13.  
  14.  
  15.  
  16. /*man-start*********************************************************************
  17.  
  18.   PDC_check_bios_key()    - Check BIOS key data area for input
  19.  
  20.   PDCurses Description:
  21.      This is a private PDCurses routine.
  22.  
  23.      This routine will check the BIOS for any indication that
  24.      keystrokes are pending.
  25.  
  26.   PDCurses Return Value:
  27.      Returns 1 if a keyboard character is available, 0 otherwise.
  28.  
  29.   PDCurses Errors:
  30.      No errors are defined for this function.
  31.  
  32.   Portability:
  33.      PDCurses    bool    PDC_check_bios_key( void );
  34.  
  35. **man-end**********************************************************************/
  36.  
  37. bool PDC_check_bios_key(void)
  38. {
  39. #ifdef    OS2
  40. #if !defined(MSC)
  41.     KBDKEYINFO keyInfo;
  42. #endif
  43. #endif
  44.  
  45. #ifdef PDCDEBUG
  46.     if (trace_on) PDC_debug("PDC_check_bios_key() - called\n");
  47. #endif
  48.  
  49. #ifdef    FLEXOS
  50.     retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  51.     return( (retcode < 0L) ? ERR : vir.vc_tahead );
  52. #endif
  53.  
  54. #if    defined (DOS)
  55.  return(kbhit());
  56. #endif
  57.  
  58. #ifdef    OS2
  59. #if !defined(MSC)
  60. /*    KbdCharIn(&keyInfo, IO_NOWAIT, 0);*/    /* get a character    */
  61.     KbdPeek(&keyInfo, 0);    /* peek at keyboard    */
  62.     return (keyInfo.fbStatus != 0);
  63. #else
  64.  return(kbhit());
  65. #endif
  66. #endif
  67.  
  68. #ifdef UNIX
  69.     return(PDC_kbhit());
  70. #endif
  71. }         
  72.